.class public Lcom/instagram/creation/video/e/l;
.super Lcom/instagram/creation/video/e/p;
.source "OESCopyFilter.java"


# instance fields
.field private g:Ljava/nio/FloatBuffer;

.field private h:Ljava/nio/FloatBuffer;

.field private i:I

.field private j:F

.field private k:F


# direct methods
.method public constructor <init>()V
    .locals 6

    .prologue
    const/16 v5, 0x20

    const/4 v4, 0x0

    .line 26
    const/4 v0, 0x0

    const/4 v1, -0x2

    const-string v2, "OES"

    const-string v3, "oes"

    invoke-direct {p0, v0, v1, v2, v3}, Lcom/instagram/creation/video/e/p;-><init>(Landroid/content/Context;ILjava/lang/String;Ljava/lang/String;)V

    .line 23
    const/high16 v0, 0x3f00

    iput v0, p0, Lcom/instagram/creation/video/e/l;->k:F

    .line 28
    invoke-static {v5}, Ljava/nio/ByteBuffer;->allocateDirect(I)Ljava/nio/ByteBuffer;

    move-result-object v0

    .line 29
    invoke-static {}, Ljava/nio/ByteOrder;->nativeOrder()Ljava/nio/ByteOrder;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/nio/ByteBuffer;->order(Ljava/nio/ByteOrder;)Ljava/nio/ByteBuffer;

    .line 30
    invoke-virtual {v0}, Ljava/nio/ByteBuffer;->asFloatBuffer()Ljava/nio/FloatBuffer;

    move-result-object v0

    iput-object v0, p0, Lcom/instagram/creation/video/e/l;->g:Ljava/nio/FloatBuffer;

    .line 32
    invoke-static {v5}, Ljava/nio/ByteBuffer;->allocateDirect(I)Ljava/nio/ByteBuffer;

    move-result-object v0

    .line 33
    invoke-static {}, Ljava/nio/ByteOrder;->nativeOrder()Ljava/nio/ByteOrder;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/nio/ByteBuffer;->order(Ljava/nio/ByteOrder;)Ljava/nio/ByteBuffer;

    .line 34
    invoke-virtual {v0}, Ljava/nio/ByteBuffer;->asFloatBuffer()Ljava/nio/FloatBuffer;

    move-result-object v0

    iput-object v0, p0, Lcom/instagram/creation/video/e/l;->h:Ljava/nio/FloatBuffer;

    .line 36
    const/high16 v0, 0x3f80

    invoke-virtual {p0, v0, v4, v4}, Lcom/instagram/creation/video/e/l;->a(FIZ)V

    .line 37
    return-void
.end method


# virtual methods
.method public a()V
    .locals 2

    .prologue
    .line 40
    iget v0, p0, Lcom/instagram/creation/video/e/l;->d:I

    const-string v1, "transformMatrix"

    invoke-static {v0, v1}, Landroid/opengl/GLES20;->glGetUniformLocation(ILjava/lang/String;)I

    move-result v0

    iput v0, p0, Lcom/instagram/creation/video/e/l;->i:I

    .line 41
    return-void
.end method

.method public a(F)V
    .locals 3
    .parameter

    .prologue
    .line 54
    const/4 v0, 0x0

    const/high16 v1, 0x3f80

    invoke-static {v1, p1}, Ljava/lang/Math;->min(FF)F

    move-result v1

    invoke-static {v0, v1}, Ljava/lang/Math;->max(FF)F

    move-result v0

    iput v0, p0, Lcom/instagram/creation/video/e/l;->k:F

    .line 55
    iget-object v0, p0, Lcom/instagram/creation/video/e/l;->g:Ljava/nio/FloatBuffer;

    iget v1, p0, Lcom/instagram/creation/video/e/l;->j:F

    iget v2, p0, Lcom/instagram/creation/video/e/l;->k:F

    invoke-static {v1, v2}, Lcom/instagram/creation/video/e/q;->a(FF)[F

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/nio/FloatBuffer;->put([F)Ljava/nio/FloatBuffer;

    .line 56
    iget-object v0, p0, Lcom/instagram/creation/video/e/l;->g:Ljava/nio/FloatBuffer;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Ljava/nio/FloatBuffer;->position(I)Ljava/nio/Buffer;

    .line 57
    return-void
.end method

.method public a(FIZ)V
    .locals 3
    .parameter
    .parameter
    .parameter

    .prologue
    const/4 v0, 0x0

    .line 44
    iput p1, p0, Lcom/instagram/creation/video/e/l;->j:F

    .line 46
    iget-object v1, p0, Lcom/instagram/creation/video/e/l;->g:Ljava/nio/FloatBuffer;

    iget v2, p0, Lcom/instagram/creation/video/e/l;->k:F

    invoke-static {p1, v2}, Lcom/instagram/creation/video/e/q;->a(FF)[F

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/nio/FloatBuffer;->put([F)Ljava/nio/FloatBuffer;

    .line 47
    iget-object v1, p0, Lcom/instagram/creation/video/e/l;->g:Ljava/nio/FloatBuffer;

    invoke-virtual {v1, v0}, Ljava/nio/FloatBuffer;->position(I)Ljava/nio/Buffer;

    .line 49
    iget-object v1, p0, Lcom/instagram/creation/video/e/l;->h:Ljava/nio/FloatBuffer;

    if-eqz p3, :cond_0

    move p2, v0

    :cond_0
    invoke-static {p2}, Lcom/instagram/creation/video/e/q;->a(I)[F

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/nio/FloatBuffer;->put([F)Ljava/nio/FloatBuffer;

    .line 50
    iget-object v1, p0, Lcom/instagram/creation/video/e/l;->h:Ljava/nio/FloatBuffer;

    invoke-virtual {v1, v0}, Ljava/nio/FloatBuffer;->position(I)Ljava/nio/Buffer;

    .line 51
    return-void
.end method

.method public a(I[F)V
    .locals 6
    .parameter
    .parameter

    .prologue
    const/16 v2, 0x1406

    const/16 v4, 0x8

    const/4 v1, 0x2

    const/4 v3, 0x0

    .line 60
    invoke-virtual {p0}, Lcom/instagram/creation/video/e/l;->c()I

    move-result v0

    invoke-static {v0}, Landroid/opengl/GLES20;->glUseProgram(I)V

    .line 61
    const v0, 0x84c0

    invoke-static {v0}, Landroid/opengl/GLES20;->glActiveTexture(I)V

    .line 62
    const v0, 0x8d65

    invoke-static {v0, p1}, Landroid/opengl/GLES20;->glBindTexture(II)V

    .line 64
    iget v0, p0, Lcom/instagram/creation/video/e/l;->b:I

    iget-object v5, p0, Lcom/instagram/creation/video/e/l;->g:Ljava/nio/FloatBuffer;

    invoke-static/range {v0 .. v5}, Landroid/opengl/GLES20;->glVertexAttribPointer(IIIZILjava/nio/Buffer;)V

    .line 66
    iget v0, p0, Lcom/instagram/creation/video/e/l;->a:I

    iget-object v5, p0, Lcom/instagram/creation/video/e/l;->h:Ljava/nio/FloatBuffer;

    invoke-static/range {v0 .. v5}, Landroid/opengl/GLES20;->glVertexAttribPointer(IIIZILjava/nio/Buffer;)V

    .line 69
    iget v0, p0, Lcom/instagram/creation/video/e/l;->i:I

    const/4 v1, 0x1

    invoke-static {v0, v1, v3, p2, v3}, Landroid/opengl/GLES20;->glUniformMatrix4fv(IIZ[FI)V

    .line 71
    const/4 v0, 0x5

    const/4 v1, 0x4

    invoke-static {v0, v3, v1}, Landroid/opengl/GLES20;->glDrawArrays(III)V

    .line 72
    return-void
.end method
